@extends('admin.container')

@section('c-head')
    <script type="text/javascript">
        var PAGE_DATA = {
            REST_API: {
                backUrl : "{{ route('admin.provider.index') }}",    // 返回地址
                rejectUrl : "{{ route('admin.provider.refuse', [$member->id]) }}", // 拒绝地址
                submitUrl : "{{ route('admin.provider.audit', [$member->id]) }}" // 同意地址
            },
            paperData : $.parseJSON('{!! \App\Http\Controllers\Admin\Member\Provider\ProviderController::fileInfo($member->id) !!}'), // 证件资料
        };
    </script>
@stop

@section('c-body')

    <div class="comm-title">
                <span class="title-msg">
                        会员 > 供应商 > 列表 > 审核
                    </span>
    </div>
    <div class="comm-body form-body">
        <form id="main-form" style="margin-top: 20px;" action="" method="post">
            {{ csrf_field() }}
            <input name="_method" value="PUT" hidden="hidden">
            <div class="clearfix">
                <div class="form-left fl tr">
                    用户名：
                </div>
                <div class="form-right fl">
                    {{ $member->user }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    登录密码：
                </div>
                <div class="form-right fl">
                    <input name="pw" type="password" style="float:left;" />
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    电子邮箱：
                </div>
                <div class="form-right fl">
                    {{ $member->email }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    公司全称：
                </div>
                <div class="form-right fl">
                    {{ $member->information->company }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    公司法人：
                </div>
                <div class="form-right fl">
                    {{ $member->information->legal }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    法人身份证：
                </div>
                <div class="form-right fl">
                    {{ $member->information->identification_number }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    所在地：
                </div>
                <div class="form-right fl">
                    {{ \App\B2BProject\Area::getName($member->information->province_id) . ' ' . \App\B2BProject\Area::getName($member->information->city_id) . \App\B2BProject\Area::getName($member->information->county_id) }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    公司地址：
                </div>
                <div class="form-right fl">
                    {{ $member->information->address }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    联系人姓名：
                </div>
                <div class="form-right fl">
                    {{ $member->information->contact_person }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    联系人电话：
                </div>
                <div class="form-right fl">
                    {{ $member->information->contact_phone }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    主营类别：
                </div>
                <div class="form-right fl">
                    {{ implode(", ", $member->store->mainCategory()->lists('name')->toArray()) }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    主营品牌：
                </div>
                <div class="form-right fl">
                    {{ implode(", ", $member->store->mainBrand()->lists('name')->toArray()) }}
                </div>
            </div>

            <div class="input-line clearfix" style="height:auto;">
                <div class="key-txt">
                    证件资料:
                </div>
                <div class="input-val picture-inlie"
                     style="width:80%; min-height:160px;"
                     id="paper-box">

                </div>
            </div>

            <div class="input-line clearfix" style="height:auto;margin-bottom: 10px;">
                <div class="key-txt">
                    拒绝原因:
                </div>
                <div class="input-val">
                    <textarea name="message"></textarea>
                </div>
            </div>

            <div class="input-line clearfix" style="height:auto;">
                <div class="key-txt">
                </div>
                <div class="input-val" style="width:255px;">
                    <input id="submit-btn" type="submit" class="am-btn am-btn-primary am-btn-lg"
                           value="同意" style="width: auto;height: auto;">
                    <button type="submit"
                            class="am-btn am-btn-success am-btn-lg returm-color cancel-btn"
                            href="" id="reject-btn">
                                <span style="display:block;">
                                    拒绝
                                </span>
                    </button>
                    <a type="button" class="am-btn am-btn-default am-btn-lg returm-color cancel-btn"
                       href="" id="back-btn">
                                <span style="display:block;">
                                    返回
                                </span>
                    </a>
                </div>
            </div>
        </form>
    </div>

    <script type="text/template" id="paper_templ">
        <%_.each(obj, function(item){%>
        <div class="data-picture">
            <div class="picture">
                <a target="_blank" class="todooflyout" href="<%=item.img%>"><img src="<%=item.img%>"></a>
            </div>
            <span style="position:relative;"><%=item.text%></span>
        </div>
        <%})%>
    </script>


    <script src="/assets/b2b/admin/js/libs/jquery.paging.min.js"></script>
    <script src="/assets/b2b/admin/js/libs/dialog-min.js"></script>

    <script src="/assets/b2b/admin/js/pages/13.js"></script>
@stop